package com.archermind.style.pojo;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.List;

public enum ElementEnum {
    text("文本","AliasTextStyleDefine","TextStyleDefine",0),
    point("点","AliasPointStyleDefine","PointStyleDefine",1),
    line("线","AliasLineStyleDefine","LineStyleDefine",2),
    polygon("面","AliasPolygonStyleDefine","PolygonStyleDefine",3),
    building("楼块","AliasBuildingStyleDefine","BuildingStyleDefine",4),
    arrow("箭头","AliasArrowStyleDefine","ArrowStyleDefine",6),
    roadSign("路牌","AliasRoadSignStyleDefine","RoadSignStyleDefine",7),

    dashLine("虚线","AliasDashLineStyleDefine",null,null);


    private String name;
    private String typeTag;
    private String styleTag;
    private Integer type;
    ElementEnum(String name,String typeTag,String styleTag,Integer type) {
        this.name = name;
        this.typeTag = typeTag;
        this.styleTag = styleTag;
        this.type = type;
    }

    public static JSONArray getDict(){
        JSONArray array = new JSONArray();
        for(ElementEnum one: ElementEnum.values()){
            JSONObject obj = new JSONObject();
            obj.put("id",one.name());
            obj.put("name",one.name);
            obj.put("type",one.type);
            array.add(obj);
        }
        return array;
    }

    public static List<ElementEnum> getRuleValues(){
        ArrayList list = new ArrayList();
        list.add(point);
        list.add(line);
        list.add(polygon);
        list.add(building);
        list.add(arrow);
        list.add(roadSign);
        return list;
    }

    public String getName() {
        return name;
    }

    public String getTypeTag() {
        return typeTag;
    }

    public String getStyleTag() {
        return styleTag;
    }

    public Integer getType() {
        return type;
    }

    public static void main(String[] args) {
        ElementEnum e = ElementEnum.point;
        System.out.println(e.toString());
    }
}
